knitr::opts_chunk$set(echo = TRUE)
library(rmarkdown)
library(tidyverse)
library(gridExtra)
library(xtable)
library(stargazer)
library(estimatr)
library(regrrr)
library(dotwhisker)
library(interplot)
library(sandwich)
library(ggpubr)
library(meta)
library(RColorBrewer)
library(rstatix)
library(cowplot)
options(scipen=999)
base_dir <- getwd()
load("data/pilot_clean.RData")
ld1 <- readRDS("data/df_clean.rds")
ld2 <- readRDS("data/df_followup_clean.rds")
ld3 <- readRDS("data/df_followup2_clean.rds")
ld4 <- readRDS("data/df_study4_clean.rds")
ld5 <- readRDS("data/df_study5_clean.rds")
ld1$treatment <- if_else(ld1$alleg_treatment == "Info. Uncertain" | ld1$alleg_treatment == "Opp. Rally", 1, 0)
ld4$treatment <- if_else(ld4$alleg_treatment == "Info. Uncertain" | ld4$alleg_treatment == "Opp. Rally", 1, 0)
ld5$treatment <- if_else(ld5$alleg_treatment == "Info. Uncertain" | ld5$alleg_treatment == "Opp. Rally", 1, 0)
#Regressing belief change on treatment
m1 <- lm(data = ld5,
belief ~ treatment +
party + gender + race + age + education + income + region + media_literacy + digital_literacy)
m2 <- lm(data = ld5 %>% filter(attentiveness==2),
belief ~ treatment +
party + gender + race + age + education + income + region + media_literacy + digital_literacy)
m3 <- lm(data = ld5,
belief ~ alleg_treatment +
party + gender + race + age + education + income + region + media_literacy + digital_literacy)
m4 <- lm(data = ld5 %>% filter(attentiveness==2),
belief ~ alleg_treatment +
party + gender + race + age + education + income + region + media_literacy + digital_literacy)
knitr::opts_chunk$set(echo = TRUE)
library(rmarkdown)
library(tidyverse)
library(gridExtra)
library(xtable)
library(stargazer)
library(estimatr)
library(regrrr)
library(dotwhisker)
library(interplot)
library(sandwich)
library(ggpubr)
library(meta)
library(RColorBrewer)
library(rstatix)
library(cowplot)
options(scipen=999)
base_dir <- getwd()
load("data/pilot_clean.RData")
knitr::opts_chunk$set(echo = TRUE)
library(rmarkdown)
library(tidyverse)
library(gridExtra)
library(xtable)
library(stargazer)
library(estimatr)
library(regrrr)
library(dotwhisker)
library(interplot)
library(sandwich)
library(ggpubr)
library(meta)
library(RColorBrewer)
library(rstatix)
library(cowplot)
options(scipen=999)
base_dir <- getwd()
load("data/pilot_clean.RData")
ld1 <- readRDS("data/df_clean.rds")
ld2 <- readRDS("data/df_followup_clean.rds")
ld3 <- readRDS("data/df_followup2_clean.rds")
ld4 <- readRDS("data/df_study4_clean.rds")
ld5 <- readRDS("data/df_study5_clean.rds")
ld1$treatment <- if_else(ld1$alleg_treatment == "Info. Uncertain" | ld1$alleg_treatment == "Opp. Rally", 1, 0)
ld4$treatment <- if_else(ld4$alleg_treatment == "Info. Uncertain" | ld4$alleg_treatment == "Opp. Rally", 1, 0)
ld5$treatment <- if_else(ld5$alleg_treatment == "Info. Uncertain" | ld5$alleg_treatment == "Opp. Rally", 1, 0)
#Regressing belief change on treatment
m1 <- lm(data = ld5,
belief ~ treatment +
party + gender + race + age + education + income + region + media_literacy + digital_literacy)
m2 <- lm(data = ld5 %>% filter(attentiveness==2),
belief ~ treatment +
party + gender + race + age + education + income + region + media_literacy + digital_literacy)
m3 <- lm(data = ld5,
belief ~ alleg_treatment +
party + gender + race + age + education + income + region + media_literacy + digital_literacy)
m4 <- lm(data = ld5 %>% filter(attentiveness==2),
belief ~ alleg_treatment +
party + gender + race + age + education + income + region + media_literacy + digital_literacy)
stargazer(m1, m2, m3, m4,
se = starprep(m1, m2, m3, m4),
covariate.labels=c("Allegation", "Info. Uncertain", "Opp. Rally",
"Strong Democrat", "Democrat", "Lean Democrat",
"Lean Republican", "Republican",
"Strong Republican",
"Female",
"Black", "Hispanic", "Asian", "Other Race",
"Millennial", "Gen X", "Boomer", "Silent Gen.",
"Some College", "Bachelor's Degree", "Graduate Degree",
"Low Income", "High Income",
"Midwest", "South", "West",
"Media Literacy",
"Digital Literacy",
"Constant"),
dep.var.labels = "Change in Belief",
keep.stat = c("n","rsq"),
title="Study 5 Belief Change Regression Results",
label="tab:study_5_belief_change",
font.size="tiny",
star.char = c("+","*","**","***"),
star.cutoffs = c(0.1,0.05,0.01,0.001),
notes = c("$^{+}$p $<$ .1; $^{*}$p $<$ .05; $^{**}$p $<$ .01; $^{***}$p $<$ .001"),
notes.append = F,
style="APSR",
add.lines = list(c("Sample", "Study 5", "Study 5 Att.", "Study 5", "Study 5 Att.")),
header=F,
type="latex",
out=file.path(base_dir, "Tables/study_5_belief_change.tex"))
